home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 November / PCWorld_2006-11_cd.bin / domacnost a kancelar / opencontacts / ocusetup.exe / setup.exe / {code_GetDataFolder} / Templates / SyncMLSIF.xsl < prev   
Extensible Markup Language  |  2006-10-03  |  8KB  |  224 lines

  1. ∩╗┐<?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <xsl:stylesheet version="1.0"
  4. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  5. <xsl:output method="xml" encoding="UTF-8" />
  6.  
  7.   <xsl:template match="/">
  8.   
  9.   
  10.   
  11.         <xsl:for-each select="OpenContacts/Contacts/Contact">
  12.  
  13. <contact>
  14. <LastName><xsl:value-of select="@Surname"/></LastName>
  15. <FirstName><xsl:value-of select="@GivenName"/></FirstName>
  16. <MiddleName><xsl:value-of select="@MidName"/></MiddleName>
  17. <Title><xsl:value-of select="@Title"/></Title>
  18. <Body><xsl:value-of select="Notes"/></Body>
  19.     <xsl:for-each select="Sections/Section">
  20.         <xsl:choose>
  21.             <xsl:when test="@Name='Personal'">
  22.  
  23.                 <xsl:for-each select="Fields/Field">
  24.                     <xsl:choose>
  25.                         <xsl:when test="@Name='Phone'">
  26. <HomeTelephoneNumber><xsl:value-of select="@Value"/></HomeTelephoneNumber>
  27. </xsl:when>
  28.                         <xsl:when test="@Name='Phone2'">
  29. <Home2TelephoneNumber><xsl:value-of select="@Value"/></Home2TelephoneNumber>
  30. </xsl:when>
  31.                         <xsl:when test="@Name='Fax'">
  32. <HomeFaxNumber><xsl:value-of select="@Value"/></HomeFaxNumber>
  33. </xsl:when>
  34.                         <xsl:when test="@Name='City'">
  35. <HomeAddressCity><xsl:value-of select="@Value"/></HomeAddressCity>
  36. </xsl:when>
  37.                         <xsl:when test="@Name='Country'">
  38. <HomeAddressCountry><xsl:value-of select="@Value"/></HomeAddressCountry>
  39. </xsl:when>
  40.                         <xsl:when test="@Name='Postcode'">
  41. <HomeAddressPostalCode><xsl:value-of select="@Value"/></HomeAddressPostalCode>
  42. </xsl:when>
  43.                         <xsl:when test="@Name='PO Box'">
  44. <HomeAddressPostOfficeBox><xsl:value-of select="@Value"/></HomeAddressPostOfficeBox>
  45. </xsl:when>
  46.                         <xsl:when test="@Name='State'">
  47. <HomeAddressState><xsl:value-of select="@Value"/></HomeAddressState>
  48. </xsl:when>
  49.                         <xsl:when test="@Name='Street'">
  50. <HomeAddressStreet><xsl:value-of select="@Value"/></HomeAddressStreet>
  51. </xsl:when>
  52.                         <xsl:when test="@Name='Address'">
  53. <HomeLabel><xsl:value-of select="@Value"/></HomeLabel>
  54. </xsl:when>
  55.                         <xsl:when test="@Name='Web'">
  56. <WebPage><xsl:value-of select="@Value"/></WebPage>
  57. </xsl:when>
  58.                         <xsl:when test="@Name='Hobby'">
  59. <Hobby><xsl:value-of select="@Value"/></Hobby>
  60. </xsl:when>
  61.                         <xsl:when test="@Name='Gender'">
  62. <Gender><xsl:value-of select="@Value"/></Gender>
  63. </xsl:when>
  64.                         <xsl:when test="@Name='Children'">
  65. <Children><xsl:value-of select="@Value"/></Children>
  66. </xsl:when>
  67.                         <xsl:when test="@Name='Email'">
  68. <Email1Address><xsl:value-of select="@Value"/></Email1Address>
  69. </xsl:when>
  70.                         <xsl:when test="@Name='Email2'">
  71. <Email2Address><xsl:value-of select="@Value"/></Email2Address>
  72. </xsl:when>
  73.                         <xsl:when test="@Name='Email3'">
  74. <Email3Address><xsl:value-of select="@Value"/></Email3Address>
  75. </xsl:when>
  76.                         <xsl:when test="@Name='Mobile'">
  77. <MobileTelephoneNumber><xsl:value-of select="@Value"/></MobileTelephoneNumber>
  78. </xsl:when>
  79.                         <xsl:when test="@Name='Nick Name'">
  80. <NickName><xsl:value-of select="@Value"/></NickName>
  81. </xsl:when>
  82.                         <xsl:when test="@Name='Spouse'">
  83. <Spouse><xsl:value-of select="@Value"/></Spouse>
  84. </xsl:when>
  85.                         <xsl:when test="@Name='Suffix'">
  86. <Suffix><xsl:value-of select="@Value"/></Suffix>
  87. </xsl:when>
  88.                         <xsl:when test="@Name='Primary Phone'">
  89. <PrimaryTelephoneNumber><xsl:value-of select="@Value"/></PrimaryTelephoneNumber>
  90. </xsl:when>
  91.                         <xsl:when test="@Name='Pager'">
  92. <PagerNumber><xsl:value-of select="@Value"/></PagerNumber>
  93. </xsl:when>
  94.                         <xsl:when test="@Name='Birthday'">
  95. <Birthday><xsl:value-of select="@Value"/></Birthday>
  96. </xsl:when>
  97.                         <xsl:when test="@Name='Anniversary'">
  98. <Anniversary><xsl:value-of select="@Value"/></Anniversary>
  99. </xsl:when>
  100.  
  101.  
  102.                     </xsl:choose>
  103.                 </xsl:for-each>
  104.  
  105.             </xsl:when>
  106.  
  107.             <xsl:when test="@Name='Work'">
  108.  
  109.                 <xsl:for-each select="Fields/Field">
  110.                     <xsl:choose>
  111.  
  112.                         <xsl:when test="@Name='Phone2'">
  113. <Business2TelephoneNumber><xsl:value-of select="@Value"/></Business2TelephoneNumber>
  114. </xsl:when>
  115.                         <xsl:when test="@Name='City'">
  116. <BusinessAddressCity><xsl:value-of select="@Value"/></BusinessAddressCity>
  117. </xsl:when>
  118.                         <xsl:when test="@Name='Country'">
  119. <BusinessAddressCountry><xsl:value-of select="@Value"/></BusinessAddressCountry>
  120. </xsl:when>
  121.                         <xsl:when test="@Name='Postcode'">
  122. <BusinessAddressPostalCode><xsl:value-of select="@Value"/></BusinessAddressPostalCode>
  123. </xsl:when>
  124.                         <xsl:when test="@Name='PO Box'">
  125. <BusinessAddressPostOfficeBox><xsl:value-of select="@Value"/></BusinessAddressPostOfficeBox>
  126. </xsl:when>
  127.                         <xsl:when test="@Name='State'">
  128. <BusinessAddressState><xsl:value-of select="@Value"/></BusinessAddressState>
  129. </xsl:when>
  130.                         <xsl:when test="@Name='Street'">
  131. <BusinessAddressStreet><xsl:value-of select="@Value"/></BusinessAddressStreet>
  132. </xsl:when>
  133.                         <xsl:when test="@Name='Fax'">
  134. <BusinessFaxNumber><xsl:value-of select="@Value"/></BusinessFaxNumber>
  135. </xsl:when>
  136.                         <xsl:when test="@Name='Address'">
  137. <BusinessLabel><xsl:value-of select="@Value"/></BusinessLabel>
  138. </xsl:when>
  139.                         <xsl:when test="@Name='Phone'">
  140. <BusinessTelephoneNumber><xsl:value-of select="@Value"/></BusinessTelephoneNumber>
  141. </xsl:when>
  142.                         <xsl:when test="@Name='Web'">
  143. <BusinessWebPage><xsl:value-of select="@Value"/></BusinessWebPage>
  144. </xsl:when>
  145.                         <xsl:when test="@Name='Assistant'">
  146. <AssistantName><xsl:value-of select="@Value"/></AssistantName>
  147. </xsl:when>
  148.                         <xsl:when test="@Name='Primary Phone'">
  149. <CompanyMainTelephoneNumber><xsl:value-of select="@Value"/></CompanyMainTelephoneNumber>
  150. </xsl:when>
  151.                         <xsl:when test="@Name='Company'">
  152. <CompanyName><xsl:value-of select="@Value"/></CompanyName>
  153. </xsl:when>
  154.                         <xsl:when test="@Name='Department'">
  155. <Department><xsl:value-of select="@Value"/></Department>
  156. </xsl:when>
  157.                         <xsl:when test="@Name='Manager'">
  158. <ManagerName><xsl:value-of select="@Value"/></ManagerName>
  159. </xsl:when>
  160.                         <xsl:when test="@Name='Profession'">
  161. <Profession><xsl:value-of select="@Value"/></Profession>
  162. </xsl:when>
  163.                         <xsl:when test="@Name='Title'">
  164. <JobTitle><xsl:value-of select="@Value"/></JobTitle>
  165. </xsl:when>
  166.  
  167.  
  168.                     </xsl:choose>
  169.                 </xsl:for-each>
  170.  
  171.             </xsl:when>
  172.  
  173.             <xsl:when test="@Name='Other'">
  174.  
  175.                 <xsl:for-each select="Fields/Field">
  176.                     <xsl:choose>
  177.                         <xsl:when test="@Name='City'">
  178. <OtherAddressCity><xsl:value-of select="@Value"/></OtherAddressCity>
  179. </xsl:when>
  180.                         <xsl:when test="@Name='Country'">
  181. <OtherAddressCountry><xsl:value-of select="@Value"/></OtherAddressCountry>
  182. </xsl:when>
  183.                         <xsl:when test="@Name='Postcode'">
  184. <OtherAddressPostalCode><xsl:value-of select="@Value"/></OtherAddressPostalCode>
  185. </xsl:when>
  186.                         <xsl:when test="@Name='PO Box'">
  187. <OtherAddressPostOfficeBox><xsl:value-of select="@Value"/></OtherAddressPostOfficeBox>
  188. </xsl:when>
  189.                         <xsl:when test="@Name='State'">
  190. <OtherAddressState><xsl:value-of select="@Value"/></OtherAddressState>
  191. </xsl:when>
  192.                         <xsl:when test="@Name='Street'">
  193. <OtherAddressStreet><xsl:value-of select="@Value"/></OtherAddressStreet>
  194. </xsl:when>
  195.                         <xsl:when test="@Name='Fax'">
  196. <OtherFaxNumber><xsl:value-of select="@Value"/></OtherFaxNumber>
  197. </xsl:when>
  198.                         <xsl:when test="@Name='Address'">
  199. <OtherLabel><xsl:value-of select="@Value"/></OtherLabel>
  200. </xsl:when>
  201.                         <xsl:when test="@Name='Phone'">
  202. <OtherTelephoneNumber><xsl:value-of select="@Value"/></OtherTelephoneNumber>
  203. </xsl:when>
  204.  
  205.  
  206.                     </xsl:choose>
  207.                 </xsl:for-each>
  208.  
  209.             </xsl:when>
  210.  
  211.         </xsl:choose>
  212.  
  213.  
  214.     </xsl:for-each>
  215.  
  216.  
  217.  
  218.  
  219.  
  220. </contact>
  221.         </xsl:for-each>
  222.   </xsl:template>
  223.  
  224. </xsl:stylesheet>